﻿
namespace Dexter.Caching.AspNet {
	internal static class Helper {
		public static string GetKey(string key) {
			return GetKey ( key , "default" );
		}

		public static string GetKey(string key, string region) {
			key = NormalizeCacheKey ( key );
			return string.Format ( "{0}:{1}" , region , key );
		}

		internal static string NormalizeCacheKey(string key) {
			if(key.Contains ( ":" ))
				return key.Replace ( ":" , "-" );

			return key;
		}
	}
}
